package com.example.service.deposit.controller;

import com.example.service.deposit.entity.OpenAccountParam;
import com.example.service.deposit.service.IOpenAccountService;
import com.example.stack.common.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/*
@author SupUncleBlack
@date 2021/8/31 - 17:13
*/
@RequestMapping
@RestController
public class OpenAccountController {
    @Autowired
    private IOpenAccountService openAccountService;

    /**
     * 开户
     *
     * @param 数据
     * @return {@code ResultEntity<String>}
     */
    @PostMapping("/openaccount")
    public ResultEntity<String> openAccount(@RequestBody OpenAccountParam data){
        String id = openAccountService.openAccount(data);
        return ResultEntity.successWithData(id);
    }
}
